<template>
	<view style="">
	　　<view class="uni_header">
			<view class="head_inner">
				<view class="head_inner_left">
					<image class="head_inner_left_icon" src="../../common/img/gongsi_bai.png" mode=""></image>
					<text class="head_inner_left_text">{{myinfo.subject_name}}</text>
				</view>
				<view class="head_inner_right">
					<image class="head_inner_left_icon" src="../../common/img/jilu.png" mode=""></image>
					<text class="head_inner_right_text" @tap="toWithdrawal(0)">提现</text>
				</view>
			</view>
			<view class="header_money"><text class="header_money_icon">￥</text><text class="header_money_number">{{myinfo.total_revenue}}</text></view>
			<view class="total_money">总收入</view>
			<view class="money_details">
				<view class="money_details_inner">
					<view class="money_details_number">￥{{myinfo.settled_balance}}</view>
					<view class="money_details_text">已结算</view>
				</view>
				<view class="detail_br"></view>
				<view class="money_details_inner">
					<view class="money_details_number">￥{{myinfo.account_balance}}</view>
					<view class="money_details_text">账户余额</view>
				</view>
			</view>
		</view>
		<!-- <view class="ads" style="margin-top: 60rpx;" @click="tomessage">
			<image class="ads_icon" src="../../common/img/gonggao.png" mode=""></image>
			<text class="ads_text">最新电动车换牌公告，点击查看详情！</text>
		</view> -->
		<view class="margin-sm margin-right-lg shadow" @click="tomessage" style="margin-top: -50rpx;">
			<wyb-noticeBar :text="ads" style="border-radius:50rpx;"/>
		</view>
		<view class="operating_box">
			<view class="operating_header">
				<view class="operating_header_left">
					<text class="operating_header_text">本月运营</text>
				</view>
				<!-- <view class="operating_header_right">
					<text class="detail_right_text">月预利润：￥20.00</text> 
					<image class="detail_icon" src="../../common/img/blue@2x.png" mode=""></image>
				</view> -->
			</view>
			<view class="operating_box_inner">
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myyyinfo.order_income}}</view>
					<view class="money_details_text" style="color: #666666;">月订收入(元)</view>
				</view>
				<view class="detail_br" style="border-left: 1rpx solid #EDEDED;position: relative;top: 25rpx;"></view>
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myyyinfo.order_electricity_fees}}</view>
					<view class="money_details_text" style="color: #666666;">电费(元)</view>
				</view>
				<view class="detail_br" style="border-left: 1rpx solid #EDEDED;position: relative;top: 25rpx;"></view>
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myyyinfo.power_consumption}}</view>
					<view class="money_details_text" style="color: #666666;">用电量(度)</view>
				</view>
			</view>
			<view class="operating_box_inner">
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myyyinfo.set_meal_income}}</view>
					<view class="money_details_text" style="color: #666666;">包时收入(元)</view>
				</view>
				<view class="detail_br" style="border-left: 1rpx solid #EDEDED;position: relative;top: 25rpx;"></view>
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myyyinfo.order_num}}</view>
					<view class="money_details_text" style="color: #666666;">本月订单(件)</view>
				</view>
				<view class="detail_br" style="border-left: 1rpx solid #EDEDED;position: relative;top: 25rpx;"></view>
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myyyinfo.property_sharing}}</view>
					<view class="money_details_text" style="color: #666666;">物业分成(元)</view>
				</view>
			</view>
			<view class="operating_box_inner">
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myyyinfo.agent_share}}</view>
					<view class="money_details_text" style="color: #666666;">代理分成(元)</view>
				</view>
				<view class="detail_br" style="border-left: 1rpx solid #EDEDED;position: relative;top: 25rpx;"></view>
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myyyinfo.platform_sharing}}</view>
					<view class="money_details_text" style="color: #666666;">平台分成(元)</view>
				</view>
				<view class="detail_br" style="border-left: 1rpx solid #EDEDED;position: relative;top: 25rpx;"></view>
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myyyinfo.norder_incomenorder_income}}</view>
					<view class="money_details_text" style="color: #666666;">今日收入(元)</view>
				</view>
			</view>
			<view class="operating_box_inner">
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myyyinfo.norder_num}}</view>
					<view class="money_details_text" style="color: #666666;">今日订单(件)</view>
				</view>
				<view class="detail_br" style="border-left: 1rpx solid #EDEDED;position: relative;top: 25rpx;"></view>
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myyyinfo.yorder_income}}</view>
					<view class="money_details_text" style="color: #666666;">昨日收入(元)</view>
				</view>
				<view class="detail_br" style="border-left: 1rpx solid #EDEDED;position: relative;top: 25rpx;"></view>
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myyyinfo.yorder_num}}</view>
					<view class="money_details_text" style="color: #666666;">昨日订单(件)</view>
				</view>
			</view>
		</view>
		<view class="operating_box" style="margin-top: 30rpx;">
			<view class="operating_header">
				<view class="operating_header_left">
					<text class="operating_header_text">运营{{myinfo.operator_day}}天</text>
				</view>
				<!-- <view class="operating_header_right">
					<text class="detail_right_text" style="color: #6FB4B0;">纯利润：￥20.00</text> 
					<image class="detail_icon" src="../../common/img/green@2x.png" mode=""></image>
				</view> -->
			</view>
			<view class="operating_box_inner">
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myinfo.districts_num}}</view>
					<view class="money_details_text" style="color: #666666;">小区数量</view>
				</view>
				<view class="detail_br" style="border-left: 1rpx solid #EDEDED;position: relative;top: 25rpx;"></view>
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myinfo.gateway_num}}</view>
					<view class="money_details_text" style="color: #666666;">网关数量</view>
				</view>
				<view class="detail_br" style="border-left: 1rpx solid #EDEDED;position: relative;top: 25rpx;"></view>
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myinfo.equipment_num}}</view>
					<view class="money_details_text" style="color: #666666;">设备数量</view>
				</view>
			</view>
			<view class="operating_box_inner">
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myinfo.order_income}}</view>
					<view class="money_details_text" style="color: #666666;">订单收入(元)</view>
				</view>
				<view class="detail_br" style="border-left: 1rpx solid #EDEDED;position: relative;top: 25rpx;"></view>
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myinfo.order_num}}</view>
					<view class="money_details_text" style="color: #666666;">订单数量</view>
				</view>
				<view class="detail_br" style="border-left: 1rpx solid #EDEDED;position: relative;top: 25rpx;"></view>
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myinfo.set_meal_income}}</view>
					<view class="money_details_text" style="color: #666666;">套餐收入(元)</view>
				</view>
			</view>
			<view class="operating_box_inner">
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myinfo.order_electricity_fees}}</view>
					<view class="money_details_text" style="color: #666666;">电费预支(元)</view>
				</view>
				<view class="detail_br" style="border-left: 1rpx solid #EDEDED;position: relative;top: 25rpx;"></view>
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myinfo.power_consumption}}</view>
					<view class="money_details_text" style="color: #666666;">总耗电量(度)</view>
				</view>
				<view class="detail_br" style="border-left: 1rpx solid #EDEDED;position: relative;top: 25rpx;"></view>
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myinfo.input_cost}}</view>
					<view class="money_details_text" style="color: #666666;">投入成本(元)</view>
				</view>
			</view>
			<view class="operating_box_inner">
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myinfo.platform_sharing}}</view>
					<view class="money_details_text" style="color: #666666;">平台分成(元)</view>
				</view>
				<view class="detail_br" style="border-left: 1rpx solid #EDEDED;position: relative;top: 25rpx;"></view>
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myinfo.property_sharing}}</view>
					<view class="money_details_text" style="color: #666666;">物业分成(元)</view>
				</view>
				<view class="detail_br" style="border-left: 1rpx solid #EDEDED;position: relative;top: 25rpx;"></view>
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myinfo.agent_share}}</view>
					<view class="money_details_text" style="color: #666666;">代理分成(元)</view>
				</view>
			</view>
			<view class="operating_box_inner">
				<view class="money_details_inner money_details_inner1">
					<view class="money_details_number" style="color: #333333;">{{myinfo.pay_annual_fee}}</view>
					<view class="money_details_text" style="color: #666666;">缴纳年费(元)</view>
				</view>
				<view class="detail_br" style="border-left: 1rpx solid #EDEDED;position: relative;top: 25rpx;"></view>
			</view>
		</view>
		<view class="operating_box" style="margin-top: 30rpx;">
			<view class="zhangdan">基础功能</view>
			<view class="operating_box_inner" style="margin-top: 49rpx;">
				<view class="base_inner" @tap="tocommunity">
					<image class="base_inner_icon" src="../../common/img/xiaoqu.png" mode=""></image>
					<view class="base_inner_text">小区管理</view>
				</view>
				<view class="base_inner" @tap="toGateway">
					<image class="base_inner_icon" src="../../common/img/wuye.png" mode=""></image>
					<view class="base_inner_text">网关管理</view>
				</view>
				<view class="base_inner" @tap="toequipment">
					<image class="base_inner_icon" src="../../common/img/shebei_guanli.png" mode=""></image>
					<view class="base_inner_text">设备管理</view>
				</view>
				<!-- <view class="base_inner">
					<image class="base_inner_icon" src="../../common/img/daili.png" mode=""></image>
					<view class="base_inner_text">代理账号</view>
				</view> -->
				<view class="base_inner"  @tap="toaccount">
					<image class="base_inner_icon" src="../../common/img/zhanghu.png" mode=""></image>
					<view class="base_inner_text">运营账号</view>
				</view>
				
			</view>
			<view class="operating_box_inner" style="margin-top: 49rpx;">
				<view class="base_inner">
					<image class="base_inner_icon" @tap="toGuiad" src="../../common/img/shouce.png" mode=""></image>
					<view class="base_inner_text">运营商手册</view>
				</view>
				<view class="base_inner" @tap="toFalt">
					<image class="base_inner_icon" src="../../common/img/guzhang.png" mode=""></image>
					<view class="base_inner_text">故障信息</view>
				</view>
				<!-- <view class="base_inner">
					<image class="base_inner_icon" src="../../common/img/kaguanli.png" mode=""></image>
					<view class="base_inner_text">卡管理</view>
				</view>
				
				<view class="base_inner">
					<image class="base_inner_icon" src="../../common/img/baimingdan.png" mode=""></image>
					<view class="base_inner_text">白名单</view>
				</view>
				 -->
			</view>
			<!-- <view class="operating_box_inner base_line" style="margin-top: 49rpx;">
				
				<view class="base_inner" @tap="toGateway">
					<image class="base_inner_icon" src="../../common/img/wangguan.png" mode=""></image>
					<view class="base_inner_text">网关管理</view>
				</view>
				
			</view> -->
		</view>
		<view class="operating_box" style="margin-top: 30rpx;">
			<view class="zhangdan">账单</view>
			<view class="operating_box_inner" style="margin-top: 49rpx;">
				<view class="base_inner" @tap="tocost">
					<image class="base_inner_icon" src="../../common/img/chengben.png" mode=""></image>
					<view class="base_inner_text">成本管理</view>
				</view>
				<view class="base_inner" @tap="toPackage">
					<image class="base_inner_icon" src="../../common/img/shouru.png" mode=""></image>
					<view class="base_inner_text">套餐收入</view>
				</view>
				<view class="base_inner" @tap="toelectricity">
					<image class="base_inner_icon" src="../../common/img/dainfei.png" mode=""></image>
					<view class="base_inner_text">电费入录</view>
				</view>
				<view class="base_inner" @tap="toannualfee">
					<image class="base_inner_icon" src="../../common/img/shebei_nianfei.png" mode=""></image>
					<view class="base_inner_text">设备年费</view>
				</view>
			</view>
			<view class="operating_box_inner base_line" style="margin-top: 49rpx;padding-bottom: 20rpx;" >
				<view class="base_inner">
					<image class="base_inner_icon" @tap="toFcjs" src="../../common/img/jiesuan.png" mode=""></image>
					<view class="base_inner_text">分成结算</view>
				</view>
				<view class="base_inner" @tap="tosettlementRecords">
					<image class="base_inner_icon" src="../../common/img/jiesuan_jilu.png" mode=""></image>
					<view class="base_inner_text">结算记录</view>
				</view>
				<!-- <view class="base_inner" @tap="tosettlement">
					<image class="base_inner_icon" src="../../common/img/kaguanli.png" mode=""></image>
					<view class="base_inner_text">分成结算</view>
				</view>
				
				<view class="base_inner">
					<image class="base_inner_icon" src="../../common/img/baimingdan.png" mode=""></image>
					<view class="base_inner_text">白名单</view>
				</view> -->
			</view>
		</view>
		<view style="height:180rpx;"></view>
		<view class="box ">
			<view class="cu-bar tabbar bg-white foot solids-top shadow">
				<view class="action" @tap="toindex">
					<view class="cuIcon-cu-image" >
						<image src="../../static/tabbar/shouye_hei.png"></image>
					</view>
					<view class="text-green">首页</view>
				</view>
				<view class="action"  @tap="tocount">
					<view class="cuIcon-cu-image">
						<image src="../../static/tabbar/baobiao_hei.png"></image>
					</view>
					<view class="text-gray">报表</view>
				</view>
				<view class="action"  @tap="tomessageInfo">
					<view class="cuIcon-cu-image">
						<image src="../../static/tabbar/xinxi_hei.png"></image>
					</view>
					<view class="text-gray">信息</view>
				</view>
				<view class="action" @tap="toorder">
					<view class="cuIcon-cu-image">
						<image src="../../static/tabbar/dingdan_hei.png"></image>
					</view>
					<view class="text-gray">订单</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import wybNoticeBar from '@/components/wyb-noticeBar/wyb-noticeBar.vue'
	export default {
		components: {
			wybNoticeBar
		},
		data() {
			return {
				myinfo:'',
				myyyinfo:'',
				ads:[]
			}
		},
		onLoad() {
			/* uni.login({
			  provider: 'weixin',
			  success: function (loginRes) {
			    console.log(loginRes);
			  }
			}); */
		},
		onShow() {
			this.gatdata();
			this.getyyinfo();
			this.getAds();
		},
		methods: {
			gatdata(){
				let that=this;
				that.http.tokenreq({
					url: 'operator/v1/getinfo'
				}).then((res) => {
					console.log("res="+JSON.stringify(res.data));
					let e=res.data;
					if(e.code==0 && e.success){
						that.myinfo=e.data;
					}
				})
			},
			getyyinfo(){
				let that=this;
				that.http.tokenreq({
					url: 'operator/v1/getmonthoperators'
				}).then((res) => {
					console.log("res="+JSON.stringify(res.data));
					let e=res.data;
					if(e.code==0 && e.success){
						that.myyyinfo=e.rows;
					}
				})
			},
			gettotalyy(){
				let that=this;
				that.http.tokenreq({
					url: 'operator/v1/gettopnotice'
				}).then((res) => {
					console.log("res="+JSON.stringify(res.data));
					let e=res.data;
					if(e.code==0 && e.success){
						that.myyyinfo=e.rows;
					}
				})
			},
			//获取运营商通知列表
			getAds(){
				let that=this;
				that.http.tokenreq({
					url: 'operator/v1/GetNotice'
				}).then((res) => {
					let e=res.data;
					console.log("e.rows="+JSON.stringify(e.rows));
					if(e.code==0 && e.success){
						let ads=[];
						let list = e.rows;
						list.forEach(item => {
							ads.push(item.title)
						});
						that.ads=ads
					}
				})
			},
			tocommunity(){
				uni.navigateTo({
					url:'../community/community/community'
				})
			},
			//电费入录
			toelectricity(){
				uni.navigateTo({
					url: '/pages/electricity/plotEle/plotEle'
				})
			},
			tocost(){
				uni.navigateTo({
					url: '../costing/costList/costList'
				})
			},
			//设备管理
			toequipment(){
				uni.navigateTo({
					url: '/pages/equipment/equipmentStatus/equipmentStatus'
				})
			},
			tomessageInfo(){
				uni.navigateTo({
					url: '/pages/message/message/message'
				})
			},
			toannualfee(){
				uni.navigateTo({
					url: '../equipment/annualfee/annualfee'
				})
			},
			tosettlement(){
				uni.navigateTo({
					url: '../settlement/settlement'
				})
			},
			toGateway(){
				uni.navigateTo({
					url: '/pages/gateway/communityGateway/communityGateway'
				})
			},
			tosettlementRecords(){
				uni.navigateTo({
					url: '/pages/settlementRecords/settlementRecords'
				})
			},
			//故障信息
			toFalt(){
				uni.navigateTo({
					url: '/pages/breakdown/faultInformation/faultInformation'
				})
			},
			//运营商手册（
			toGuiad(){
				uni.navigateTo({
					url: '/pages/community/guide/guide'
				})
			},
			//分成结算
			toFcjs(){
				uni.navigateTo({
					url: '/pages/settlement/settlement'
				})
			},
			//运营商首页
			toindex(){
				uni.navigateTo({
					url: '/pages/index/index'
				})
			},
			//主页报表
			tocount(){
				uni.navigateTo({
					url: '/pages/count/count'
				})
			},
			//消息
			tomessage(){
				uni.navigateTo({
					url: '/pages/message/noticeList/noticeList'
				})
			},
			// 我要提现
			toWithdrawal(type){
				uni.navigateTo({
					url:"/pages/toWithdrawal/toCash?balance="+this.myinfo.account_balance+"&type="+type
				})
			},
			//运营商首页订单
			toorder(){
				uni.navigateTo({
					url: '/pages/order/order/order'
				})
			},
			//运营账号
			toaccount(){
				uni.navigateTo({
					url: '/pages/community/commaccount/commaccount'
				})
			},
			// 小区套餐
			toPackage(){
				uni.navigateTo({
					url:'/pages/index/package'
				})
			}
			
		}
	}
</script>
<style>
	.operating_header{
		padding-top:0px;
	}
	uni-view {
	    font-size: 14px;
	    line-height:1.5;
	}
	.operating_header_left{
		background-color:#E3EBFE;
		padding:8rpx 0;
		border-radius:5rpx 10rpx 40rpx 5rpx;
		box-shadow: 5rpx #E3EBFE;
	}
	.operating_header_text{
		color:#000000;
	}
	/* page{
		background-color: #FFFFFF;
	} */
	.cu-bar.tabbar .action [class*="cuIcon-"]{
		width: 80rpx;
		height:55rpx;
	} 
	.cu-bar.tabbar{
		height:120rpx !important;
	}
	.cu-bar.tabbar .action{
		height:80rpx;
	}
	.total_money{
	    margin-bottom:10rpx;
	}
	.header_money{
		 margin-top:10rpx;
	}
</style>

